.class public Lcom/a0soft/gphone/app2sd/main/MemInfoView;
.super Landroid/widget/TextView;
.source "MemInfoView.java"


# instance fields
.field a:Landroid/graphics/drawable/Drawable;

.field private b:J

.field private c:J

.field private d:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 33
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/a0soft/gphone/app2sd/main/MemInfoView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 34
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 39
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/TextView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 41
    invoke-direct {p0, p1}, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->a(Landroid/content/Context;)V

    .line 42
    return-void
.end method

.method private a(Landroid/content/Context;)V
    .locals 6
    .parameter

    .prologue
    const-wide/16 v1, 0x0

    .line 49
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v3, 0x7f020027

    invoke-virtual {v0, v3}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->a:Landroid/graphics/drawable/Drawable;

    .line 67
    const-string v5, ""

    move-object v0, p0

    move-wide v3, v1

    invoke-virtual/range {v0 .. v5}, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->a(JJLjava/lang/String;)V

    .line 68
    return-void
.end method


# virtual methods
.method public final a(JJLjava/lang/String;)V
    .locals 5
    .parameter
    .parameter
    .parameter

    .prologue
    const-wide/16 v2, 0x0

    .line 73
    invoke-virtual {p0}, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    .line 74
    cmp-long v1, p1, v2

    if-lez v1, :cond_0

    .line 75
    iput-wide p1, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->b:J

    .line 76
    iput-wide p3, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->c:J

    .line 77
    const v1, 0x7f05001c

    const/4 v2, 0x3

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-static {p1, p2}, Lcom/a0soft/gphone/a/b;->a(J)Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    const/4 v3, 0x1

    invoke-static {p3, p4}, Lcom/a0soft/gphone/a/b;->a(J)Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    const/4 v3, 0x2

    aput-object p5, v2, v3

    invoke-virtual {v0, v1, v2}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->d:Ljava/lang/String;

    .line 87
    :goto_0
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->d:Ljava/lang/String;

    invoke-virtual {p0, v0}, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->setText(Ljava/lang/CharSequence;)V

    .line 88
    return-void

    .line 83
    :cond_0
    iput-wide v2, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->c:J

    iput-wide v2, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->b:J

    .line 84
    iput-object p5, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->d:Ljava/lang/String;

    goto :goto_0
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 7
    .parameter

    .prologue
    const/4 v6, 0x0

    .line 93
    invoke-virtual {p0}, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->getWidth()I

    move-result v0

    .line 94
    invoke-virtual {p0}, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->getHeight()I

    move-result v1

    .line 96
    iget-wide v2, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->b:J

    const-wide/16 v4, 0x0

    cmp-long v2, v2, v4

    if-lez v2, :cond_0

    .line 97
    iget-wide v2, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->c:J

    long-to-float v2, v2

    iget-wide v3, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->b:J

    long-to-float v3, v3

    div-float/2addr v2, v3

    int-to-float v3, v0

    mul-float/2addr v2, v3

    invoke-static {v2}, Ljava/lang/Math;->round(F)I

    move-result v2

    invoke-static {v0, v2}, Ljava/lang/Math;->min(II)I

    move-result v2

    .line 98
    sub-int v2, v0, v2

    .line 99
    if-lez v2, :cond_0

    .line 100
    iget-object v3, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3, v6, v6, v0, v1}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 102
    const/4 v0, 0x2

    invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->save(I)I

    .line 111
    invoke-virtual {p1, v6, v6, v2, v1}, Landroid/graphics/Canvas;->clipRect(IIII)Z

    .line 112
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/MemInfoView;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 113
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 130
    :cond_0
    invoke-super {p0, p1}, Landroid/widget/TextView;->onDraw(Landroid/graphics/Canvas;)V

    .line 131
    return-void
.end method
